var lin_popup={
		obj:null,
		closeObj:null,
		maskObj:null,
		param:null,
		init:function(param){
			var that=this;
			that.param=param;
			that.insertTpl();
			that.location();
			that.bindEvent();
			return that;
		},
		bindEvent:function(){
			var that=this;
			that.closeObj.on('click',function(){
				that.closePopup();
				if(typeof(that.param.closeCallback)=='function')
				{
					that.param.closeCallback();
				}
			});
		},
		closePopup:function(){
			this.obj.remove();
			this.maskObj.remove();
		},
		location:function(){
			var that=this,
			bodyH=$('body').height(),windowH=$(window).height();
			if(bodyH<windowH)bodyH=windowH;
			that.maskObj.css({
				height:bodyH
			});
			that.obj.css({
				top:(windowH-that.obj.outerHeight())/2+$(window).scrollTop(),
				marginLeft:-(that.obj.outerWidth()/2)
			});
			if(that.param.isScroll)
			{
				$(window).scroll(function(){
					that.obj.css({
						top:(windowH-that.obj.outerHeight())/2+$(window).scrollTop()
					});
				});
			}
		},
		insertTpl:function(){
			var that=this;
			var id='p'+ new Date().getTime(),
			popupHtml='<div class="popup" id="'+id+'">'+
			'<a href="javascript:void(0);" class="popup_close">关闭</a>'+
			'<div class="popup_content">'+
			'</div>'+
			'</div>'+
			'<div class="popup_mask"></div>';
			$('body').append(popupHtml);
			that.obj=$('#'+id);
			that.closeObj=that.obj.find('.popup_close');
			that.maskObj=$('.popup_mask');
			that.obj.find('.popup_content').html(that.param.html);
		}
};